<template>
	<view class="modal_confirm">
		<view class="modal_mask"></view>
		<view class="modal_modal">
			<view class="modal_modal__hd">
				<view>{{title}}</view>
			</view>
			<view class="modal_modal__bd">{{tips}}</view>
			<view class="modal_modal__ft">
				<view class="modal_modal__btn" :class="cancleColor" @tap="cancle()"> {{cancleText}} </view>
				<view class="modal_modal__btn" :class="confirmColor" @tap="confirm()"> {{confirmText}} </view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			title:{
				type:String,
				default:()=>"温馨提示"
			},
			tips:{
				type:String,
				default:()=>"这是提示信息这是提示信息这是提示信息这是提示信息"
			},
			cancleText:{
				type:String,
				default:()=>"取消"
			},
			cancleColor:{
				type:String,
				default:()=>"modal_modal__btn_default"
			},
			confirmText:{
				type:String,
				default:()=>"确定"
			},
			confirmColor:{
				type:String,
				default:()=>"modal_modal__btn_primary"
			}
		},
		data(){
			return {
				
			}
		},
		methods:{
			cancle(){
				this.$emit("modalCancle");
			},
			confirm(){
				this.$emit("modalConfirm");
			}
		}
	}
</script>

<style lang="scss" scoped>
	.modal_mask {
	    position: fixed;
	    z-index: 999;
	    top: 0;
	    right: 0;
	    left: 0;
	    bottom: 0;
	    background: rgba(0,0,0,.6)
	}
	.modal_confirm {
	    position: fixed;
	    top: 0;
	    right: 0;
	    bottom: 0;
	    left: 0;
	    z-index: 999;
	    display: block;
	    box-sizing: border-box
	}
	
	.modal_confirm .modal_modal {
	    position: fixed;
	    z-index: 999;
	    width: 80%;
	    max-width: 300px;
	    top: 50%;
	    left: 50%;
	    -webkit-transform: translate(-50%,-50%);
	    transform: translate(-50%,-50%);
	    background-color: #fff;
	    text-align: center;
	    border-radius: 3px;
	    overflow: hidden
	}
	
	.modal_confirm .modal_modal * {
	    box-sizing: border-box
	}
	
	.modal_confirm .modal_modal__hd {
	    padding: 1em 1.6em .3em
	}
	
	.modal_confirm .modal_modal__title {
	    font-weight: 400;
	    font-size: 18px;
	    overflow: hidden;
	    text-overflow: ellipsis;
	    display: -webkit-box;
	    -webkit-line-clamp: 2;
	    -webkit-box-orient: vertical
	}
	
	.modal_confirm .modal_modal__bd,.modal_confirm .modal_modal__title {
	    word-wrap: break-word;
	    word-break: break-all;
	    white-space: pre-wrap
	}
	
	.modal_confirm .modal_modal__bd {
	    padding: 1.3em 1.6em 1.3em;
	    min-height: 40px;
	    font-size: 15px;
	    line-height: 1.4;
	    color: #999;
	    max-height: 400px;
	    overflow-y: auto
	}
	
	.modal_confirm .modal_modal__ft {
	    position: relative;
	    line-height: 48px;
	    font-size: 18px;
	    display: -webkit-box;
	    display: -webkit-flex;
	    display: flex
	}
	
	.modal_confirm .modal_modal__ft:after {
	    content: " ";
	    position: absolute;
	    left: 0;
	    top: 0;
	    right: 0;
	    height: 1px;
	    border-top: 1px solid #d5d5d6;
	    color: #d5d5d6;
	    -webkit-transform-origin: 0 0;
	    transform-origin: 0 0;
	    -webkit-transform: scaleY(.5);
	    transform: scaleY(.5)
	}
	
	.modal_confirm .modal_modal__btn {
	    display: block;
	    -webkit-box-flex: 1;
	    -webkit-flex: 1;
	    flex: 1;
	    color: #3cc51f;
	    text-decoration: none;
	    -webkit-tap-highlight-color: rgba(0,0,0,0);
	    position: relative
	}
	
	.modal_confirm .modal_modal__btn:active {
	    background-color: #eee
	}
	
	.modal_confirm .modal_modal__btn:after {
	    content: " ";
	    position: absolute;
	    left: 0;
	    top: 0;
	    width: 1px;
	    bottom: 0;
	    border-left: 1px solid #d5d5d6;
	    color: #d5d5d6;
	    -webkit-transform-origin: 0 0;
	    transform-origin: 0 0;
	    -webkit-transform: scaleX(.5);
	    transform: scaleX(.5)
	}
	
	.modal_confirm .modal_modal__btn:first-child:after {
	    display: none
	}
	
	.modal_confirm .modal_modal__btn_default {
	    color: #353535
	}
	
	.modal_confirm .modal_modal__btn_primary {
	    color: $zhuse;
	}
</style>
